import { Component } from 'react'
import { Redirect } from 'react-router-dom'

function middle(Com) {
    return class NewCom extends Component {
        render() {
            let com = sessionStorage.getItem('token')? <Com/>: <Redirect to="/login"/>
            return com
        }
    }
}

export {
    middle
}